package com.homson.coreservice.servicecommon.utils;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Properties;

public class ApiKeyUtils {
    
    public static Properties loadApiKeys() {
        try {
            Path filePath = Paths.get("/Users/homson_leo/Desktop/llm key.txt");
            String content = Files.readString(filePath).trim();
            
            Properties props = new Properties();
            String[] lines = content.split("\n");
            for (String line : lines) {
                String[] parts = line.split("=", 2);
                if (parts.length == 2) {
                    props.setProperty(parts[0].trim(), parts[1].trim());
                }
            }
            return props;
        } catch (IOException e) {
            throw new RuntimeException("Failed to read API keys from file: llm key.txt", e);
        }
    }
}
